<script setup lang="ts">
interface Props {
  info: {
    stockNum: number;
    spareDto: AppSysSpare.Dto;
  };
}

const props = withDefaults(defineProps<Props>(), {
  info: () => {
    return {
      stockNum: 0,
      spareDto: {},
    };
  },
});
</script>

<template>
  <view class="app-spare-stock-item">
    <view class="app-spare-stock-item--left">
      {{ props.info.spareDto.spareName || '-' }}({{
        props.info.spareDto.spareCode || '-'
      }})&nbsp;&nbsp;(库存数:{{ props.info.stockNum }})
    </view>
    <view
      class="app-spare-item--right"
      :style="{ color: props.info.stockNum ? '#507aee' : '#999' }"
    >
      <text>选择</text>
    </view>
  </view>
</template>

<style lang="scss">
@import './index.scss';
</style>
